Skip to content

feat: implement Google SSO and Password Reset flows#994

Merged
yusuftomilola merged 5 commits into
DistinctCodes:mainfrom
SharifIbrahimDev:main
Jun 25, 2026
Merged

feat: implement Google SSO and Password Reset flows#994
yusuftomilola merged 5 commits into
DistinctCodes:mainfrom
SharifIbrahimDev:main

Conversation

@SharifIbrahimDev

Copy link
Copy Markdown

��## Description

This PR implements two major security and authentication flows in the backend:

  1. Forgot / Reset Password Flow (BE-12)
  2. Google OAuth 2.0 SSO (BE-14)

Password Reset Flow

  • Rebuilt the PasswordResetToken entity with relations to User.
  • Added /auth/forgot-password endpoint: securely generates a random token, hashes it with bcrypt, and saves it in the database with a 1-hour expiration timestamp.
  • Added /auth/reset-password endpoint: validates the raw token against the stored hash, validates expiry, updates the user's password, and marks the token as used.

Google SSO

  • Integrated passport-google-oauth20 with a new GoogleStrategy.
  • Added /auth/google and /auth/google/callback endpoints.
  • Updated User entity to include a nullable googleId field. Existing users are automatically linked to their Google account if the email matches.

Notes on Dependencies

  • Re-created basic scaffolding for User and MailService since the opsce module was wiped out in a recent commit on main.

Related Issues

Closes #885
Closes #887

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Security enhancement

Verification

  • Validated that
    pm run build succeeds locally.
  • Verified that sensitive variables (GOOGLE_CLIENT_ID, FRONTEND_URL) are correctly mapped via ConfigService.

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@SharifIbrahimDev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@yusuftomilola yusuftomilola merged commit 10df622 into DistinctCodes:main Jun 25, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants